package com.example2016.cjj.mycustomviewdemo;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Button  btn_customtextview = (Button) findViewById(R.id.btn_customtextview);
        btn_customtextview.setOnClickListener(this);

        Button  btn_customimageview = (Button) findViewById(R.id.btn_customimageview);
        btn_customimageview.setOnClickListener(this);


        Button  btn_customringview = (Button) findViewById(R.id.btn_customringview);
        btn_customringview.setOnClickListener(this);


        Button  btn_customviewgroup = (Button) findViewById(R.id.btn_customviewgroup);
        btn_customviewgroup.setOnClickListener(this);


        Button  btn_customdragview = (Button) findViewById(R.id.btn_customdragview);
        btn_customdragview.setOnClickListener(this);

        Button  btn_customScrollerview = (Button) findViewById(R.id.btn_customScrollerview);
        btn_customScrollerview.setOnClickListener(this);

        Button  btn_test = (Button) findViewById(R.id.btn_customlistview);
        btn_test.setOnClickListener(this);

        Button  btn_customimagegroup = (Button) findViewById(R.id.btn_customimagegroup);
        btn_customimagegroup.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.btn_customtextview:
                Intent intent1 = new Intent(MainActivity.this,CustomTextViewActivity.class);
                startActivity(intent1);
                break;
            case R.id.btn_customimageview:
                Intent intent2 = new Intent(MainActivity.this,CustomImageViewActivity.class);
                startActivity(intent2);
                break;
            case R.id.btn_customringview:
                Intent intent3 = new Intent(MainActivity.this,CustomRingViewActivity.class);
                startActivity(intent3);
                break;
            case R.id.btn_customviewgroup:
                Intent intent4= new Intent(MainActivity.this,CustomViewGroupActivity.class);
                startActivity(intent4);
                break;
            case R.id.btn_customdragview:
                Intent intent5= new Intent(MainActivity.this,CustomDragViewActivity.class);
                startActivity(intent5);
                break;
            case R.id.btn_customScrollerview:
                Intent intent6= new Intent(MainActivity.this,CustomScrollerViewActivity.class);
                startActivity(intent6);
                break;

            case R.id.btn_customlistview:
                Intent intent7= new Intent(MainActivity.this,CustomListViewActivity.class);
                startActivity(intent7);
                break;
            case R.id.btn_customimagegroup:
                Intent intent8= new Intent(MainActivity.this,CustomImageGroupActivity.class);
                startActivity(intent8);
                break;

        }
    }
}
